package h.a.a.k;

import java.util.List;
import java.util.Objects;

/* compiled from: Query */
public class f<T> extends c<T> {
    public final b<T> f;

    /* compiled from: Query */
    public static final class b<T2> extends b<T2, f<T2>> {
        public final int e;
        public final int f;

        public b(h.a.a.a<T2, ?> aVar, String str, String[] strArr, int i, int i2) {
            super(aVar, str, strArr);
            this.e = i;
            this.f = i2;
        }

        public a a() {
            return new f(this, this.b, this.a, (String[]) this.c.clone(), this.e, this.f, null);
        }
    }

    public f(b bVar, h.a.a.a aVar, String str, String[] strArr, int i, int i2, a aVar2) {
        super(aVar, str, strArr, i, i2);
        this.f = bVar;
    }

    public static <T2> f<T2> c(h.a.a.a<T2, ?> aVar, String str, Object[] objArr, int i, int i2) {
        return (f) new b(aVar, str, a.b(objArr), i, i2).b();
    }

    public f<T> d() {
        a aVar;
        b bVar = this.f;
        Objects.requireNonNull(bVar);
        if (Thread.currentThread() == this.e) {
            String[] strArr = bVar.c;
            System.arraycopy(strArr, 0, this.d, 0, strArr.length);
            aVar = this;
        } else {
            aVar = bVar.b();
        }
        return (f) aVar;
    }

    public List<T> e() {
        a();
        return this.b.a.loadAllAndCloseCursor(this.a.getDatabase().h(this.c, this.d));
    }
}
